symmetrical sum python

35

### START FUNCTION
def symmetrical_sum(a):
    while a and a[0] != a[-1]:
        _, *a, _ = a
    return (a, sum(a))
### END FUNCTION

Comments

Submit
0 Comments